package crons

import (
	"SSO/controllers/sso"
	"fmt"
	"github.com/robfig/cron"
	"log"
)

func Register() {
	c := cron.New()
	err := c.AddFunc("0 0 1 * * ?", func() {
		log.Println("Run models.CleanExpireLogin...")
		sso.SSO{}.ClearExpireLogin()
	})

	if err != nil {
		fmt.Println(err)
	}
	c.Start()
}